package com.qf.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qf.mapper.DtsUserMapper;
import com.qf.pojo.DtsUser;
import com.qf.service.DtsUserService;
import com.qf.mapper.StatMapper;
import com.qf.vo.DayStatis;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ZhangYuJie
 * projectName:shop_manage
 * time:2022/5/17 8:18
 * description:
 */
@Service
public class DtsUserServiceImpl implements DtsUserService {

    @Autowired
    DtsUserMapper userMapper;

    @Autowired
    StatMapper statMapper;

    @Override
    public int count() {
        QueryWrapper<DtsUser> wapper = new QueryWrapper<>();
        wapper.eq("deleted", false);
        Integer count = userMapper.selectCount(wapper);
        return count;
    }

    @Override
    public List<DayStatis> recentCount(int statisDaysRang) {
        List<DayStatis> list = statMapper.statisIncreaseUserCnt(statisDaysRang);
        return list;
    }
}
